package com.gary.chainOfResponsibility;

/**
 * 责任链模式调用客户端
 * @author peng_rui
 * @date 2023/9/13
 */
public class Client {
    public static void main(String[] args) {
        FirstHandler firstHandler = new FirstHandler();
        SecondHandler secondHandler = new SecondHandler();
        firstHandler.setNextHandler(secondHandler);

        ChainContext chainContext = new ChainContext();
        chainContext.setId("1");
        chainContext.setName("第一条");

        firstHandler.process(chainContext);

        System.out.println(chainContext.getRecord());
    }
}
